<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  
  <link rel="stylesheet" href="plug-in/tools/css/metrole/common.css">
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
   <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  
  <script type="text/javascript">
  	
  </script>
  <style>
    body{
    	background-color:rgb(248,249,251);    	
    }
  	.panelTitle{
  		color:#1aad19;
  		line-height: 40px;
    	height: 40px;
    	font-size: 16px;
    	text-align:center;
    	border-bottom:1px solid #e6e7ea;
    	margin-bottom:50px;
  	}
  	
  	.selectList a{
  		text-decoration: underline;
  	}
  	
  	.container{
  		background-color: white;
  		width: 80%;
    	max-width: 1280px;
    	margin: 0 auto;
    	min-height: 500px;
  	}
  	
  	.demoTable{
  		border-collapse: collapse;  		
  	}
  	
  	.demoTable td{
  		padding-bottom: 40px;
  	}
  	
  	.demoTable .tdTitle{
  		padding-right:10px;  		
  	}
  	
  	.inputxt{
  		height:30px;
  		width:80px;  		
  		text-align: right;
  	}  
  	
  	.signTD{
  		width:100px;
  		border-bottom:1px solid black;
  	}
  	
  	#file_upload-queue{
  		display:none;
  	}
  </style>
 </head>
 <body>
 <div class="container" style="padding-top:50px;padding-left:30px;">
 <!-- <div class="panelTitle">
 	请输入信息
 </div> --> 
		<table  class="demoTable">
				<tr>
					<td style="text-align:right;">
						日期
					</td>
					<td colspan="2" style="text-align: center">
						2017/07-2017/09
					</td>
					<td colspan="2" style="text-align: center">
					<button  class="btn btn_primary btn_input" onclick="downloadExcel()">下载Excel</button>
					<button  class="btn btn_primary btn_input" onclick="downloadPdf()">下载PDF</button>
					</td>
				</tr>
				<tr>
					<td align="right" style="width:100px;" class="tdTitle">					
					</td>
					<td style="width:130px;text-align: right">数额</td>
					<td style="width:130px;text-align: right;">增值税</td>
					<td style="width:130px;text-align: right">净额</td>
					<td style="width:130px;text-align: right;">备注</td>					
				</tr>
				<tr>
					<td align="right" style="width:100px;text-align: right" class="tdTitle">
						<label class="Validform_label">
							销售额:
						</label>
					</td>
					<td class="value" style="text-align: right">${apply.sellAmount}</td>
					<td class="value" style="text-align: right;">${apply.sellAmountTax}</td>
					<td class="value" style="text-align: right">						 	 
						${apply.sellAmount-apply.sellAmountTax}
					</td>
					<td class="value" style="text-align: right">					 	 
						
					</td>
					
				</tr>
				<tr>
					<td align="right" class="tdTitle">
						<label class="Validform_label">
							开支:
						</label>
					</td>
					<td class="value" style="text-align: right">${apply.spendAmount}</td>
					<td class="value" style="text-align: right;">${apply.spendAmountTax}</td>
					<td class="value" style="text-align: right">						 	 
						${apply.spendAmount-apply.spendAmountTax}
					</td>
					<td class="value" style="text-align: right">						 	 
					</td>
				</tr>
				<tr>
					<td align="right" class="tdTitle">
						<label class="Validform_label">
							利润:
						</label>
					</td>
					<td class="value" style="text-align: right">${apply.balance}</td>
					<td class="value" id="balanceTax" style="text-align:right;">						
					</td>
					<td class="value" style="text-align: right" id="balance"></td>
					<td class="value" style="text-align: right"></td>
				</tr>								
 			</table> 
 			<table>
 				<tr>
 					<td>签名：</td>
 					<td class="signTD">
 						<img id="signImg" style="height:50px;" src="cms-attach.do?getByOwner&ownerId=${apply.id}">					
 					</td>
 					 
 				</tr>
 				
 			</table>
	</div>
 </body>
 <script type="text/javascript"> 
 $(document).ready(function(){
	 var balance = ${apply.balance};
	 var balanceTax = balance/(1*11);
	 balanceTax = balanceTax.toFixed(2);
	 $('#balanceTax').text(balanceTax);
	
	 var amount = balance-balanceTax;
	 $('#balance').text(amount);
	 
 });
 
 function downloadExcel(){
	 window.location.href="selectService.do?exportExcel&id=${apply.id}"
 }
 

 function downloadPdf(){
	 window.location.href="selectService.do?exportPdf&id=${apply.id}"
 }
 
 
 </script>
